<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVenue extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('venue', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->default('')->comment('名称');
            $table->string('addr')->default('')->comment('地址');
            $table->string('addr_lat')->default(0)->comment('纬度');
            $table->string('addr_lng')->default(0)->comment('经度');
            $table->string('phone')->default('')->comment('电话');
            $table->string('remark')->default('')->comment('备注');
            $table->tinyInteger('status')->default(0)->comment('状态');
            $table->tinyInteger('type')->default(0)->comment('类型');
            $table->timestamps();
        });
        Schema::table('matches', function (Blueprint $table) {
            $table->integer('venue_id')->default(0)->comment('场馆ID')->after('level_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('venue');
    }
}
